from langchain_deepseek import ChatDeepSeek
from langchain_core.prompts import ChatPromptTemplate

llm = ChatDeepSeek(
    model="deepseek-chat",
    temperature=0.8,
    max_tokens=None,
    timeout=None,
    max_retries=2,
    api_key='sk-a4a29573469c4bb086f97c988579dd1d'
)

messages = ChatPromptTemplate([
    (
        "system",
         "您是一个有用的助手，负责将 {input_language} 翻译成 {output_language}。",
    ),
    ("human", "{input}"),
])

chain = messages | llm

ai_msg = chain.invoke({
    'input_language': 'English',
    'output_language': 'Chinese',
    'input': 'Hello, how are you?'
})
print(ai_msg.content)